<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>
<script>
    // 向数组后添加元素，返回数组的长度，更改数组
    Array.prototype.myPush = function () {
        var a = arguments;
        var arr = this;
        for (var i = 0; i < a.length; i++) {
            arr[arr.length] = a[i];
        }
        return arr.length;


    }
    var arr = [1, 2, 3]
    arr.myPush(4, 5, 6)
    console.log(arr);
</script>

</html>